﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using BUS;
using Public;


namespace QuanLyKhoHangVatTu
{
    public partial class ChiTietVatTuHangHoa : DevExpress.XtraEditors.XtraForm
    {
        VatTu_BUS vattu_bus = new VatTu_BUS();
        VatTu_PB vattu_pb = new VatTu_PB();
        Flag_PB flag_pb = new Flag_PB();
        public ChiTietVatTuHangHoa()
        {
            InitializeComponent();
        }

        private void ChiTietVatTuHangHoa_Load(object sender, EventArgs e)
        {
            Flag_PB.Flag = 3;
            gridVatTu.DataSource = vattu_bus.LayDSVatTu();
        }

        private void gridView1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
        {
            VatTu_PB.MaVatTu = gridView1.GetRowCellValue(e.FocusedRowHandle, "MAVATTU").ToString();
            VatTu_PB.TenVatTu = gridView1.GetRowCellValue(e.FocusedRowHandle, "TENVATTU").ToString();
            VatTu_PB.TinhChat = gridView1.GetRowCellValue(e.FocusedRowHandle, "TINHCHAT").ToString();
            VatTu_PB.Nhom = gridView1.GetRowCellValue(e.FocusedRowHandle, "NHOM").ToString();
            VatTu_PB.MoTa = gridView1.GetRowCellValue(e.FocusedRowHandle, "MOTA").ToString();
            VatTu_PB.DonViTinh = gridView1.GetRowCellValue(e.FocusedRowHandle, "DONVITINH").ToString();
            VatTu_PB.ThoiHanBH = gridView1.GetRowCellValue(e.FocusedRowHandle, "THOIHANBH").ToString();
            VatTu_PB.NguonGoc = gridView1.GetRowCellValue(e.FocusedRowHandle, "NGUONGOC").ToString();
        }
    }
}